package com.chixing.day04_oop.work;

import java.util.Random;

public class BankTest {
    public static void main(String[] args) {
        Random random=new Random();
        for (int i = 0; i < 10; i++) {
            int randNum = random.nextInt(10) + 1;
            System.out.println(randNum);
        }
         System.out.println("===============");
        int zeroSize=0,oneSize=0;
        for (int i = 0; i < 10; i++) {
            double floor = Math.floor(Math.round(Math.random()));
            int rand=(int)floor;
            if(zeroSize < 7&&rand==0) {
                System.out.println(rand);
                zeroSize++;
            }else if(rand==1&&oneSize < 3) {
                System.out.println(rand);
                oneSize++;
            }else
                i--;
        }
    }
}
